1. Field of Invention
This system involves an object persistence framework for an object-oriented program, which provides a persistent class, data storage class, a data cursor class that permits class bindery, that permits specialized implementations of object storage and retrieval with heterogeneous permanent storage systems.
2. Background Art
The development of application and system software for data processing systems has traditionally been a time consuming task. The field of software engineering has attempted to overcome the limitations of traditional techniques by proposing new, more efficient software development models. Object oriented programming has emerged as a promising technology that will allow rapid development, implementation and customization of new software systems. Object oriented programming uses a tool kit of system objects that can be assembled to perform a final task. Each object has certain data attributes and processes or methods that operate on the data. Data is said to be "encapsulated" by an object and can only be modified by the object methods. Methods are invoked by sending a message to an object identifying the method and supplying any needed arguments.
Object oriented systems have two important properties in addition to encapsulation. "Inheritance" is the ability to derive a new object from an existing object and inherit all properties, including, methods and data structure, from the existing object. The new object may have certain unique features which are supplied as overrides or modifications to the existing class. For example, a new subclass needs to specify only the functions and the data that distinguish that class from the existing more general class.
The ability to override an existing method description is termed polymorphism because a single message to an object can be processed in different ways depending on the object itself. Inheritance and polymorphism create a powerful structure for implementing new software systems. The software developer does not have to develop each piece of a system, they need only specify the unique features of the system.
The power of object oriented systems is realized through the development of system "Frameworks". A Framework is a collection of base classes that can be used by a system implementor to create a final systems product. The Framework is defined and developed to work as part of an associative system. Conceptually, the Framework is much like a set of standard hardware components used by computer hardware builders. Each of the components has certain defined functions and interfaces and the engineer assembles these components according to a particular design to create a unique hardware system.
Objects created by a data processing system are typically maintained in volatile memory of those systems. This allows faster processing, but does not provide a means to tore data. Object oriented systems solve this problem by implementing "persistent objects".
Regarding the term "persistence", is defined as follows. In Object-Oriented-Programming, the permanence of an object, particularly relevant in the context of object-oriented databases, which maintains a distinction between objects created only for the duration of execution and those intended for permanent storage. Thus persistence means that the object's state can be preserved beyond the termination of the process that created the object. The persistent framework includes methods that allow persistent objects to be stored in and retrieved from a non-volatile medium such as a hard disk drive or a writable optical-disk. Objects can be stored individually or grouped with other objects.
The literature defines an "object-oriented" program as one that (1) uses objects, not algorithms as its functional building blocks, (2) has each object being an instance of some class, and (3) has classes related to each other via inheritance relationships. An "object" comprises a data structure and a set of operations or set of methods, that can access and manipulate data. A "Class" is an abstract representation of an object and can be seen as a template for an object. An executing software program creates instances of these Classes called objects. Classes can be interrelated via an inheritance relationship to facilitate class data and operation reuse.
For example, we can create an abstract class termed "employee" that comprises the data and operations common to all employees. We can then create more specific employee classes called "Full-Time" and "Part-Time" to represent two specific employees. The "Full-Time" and "Part-Time" classes which have inheritance relationships with the Employee Class, will inherit the common data and operations from the abstract Employee Class. Interrelated classes form a class hierarchy whose topmost class is termed the "Root". Abstract classes are super-classes of more specific derived classes. Derived classes are subclasses of more abstract classes. A single inheritance class hierarchy is a hierarchy in which "each class" in the hierarchy can have no more than one parent. Whereas a multiple inheritance hierarchy is a hierarchy in which each class in the hierarchy can have more than one parent.
When an object-oriented program executes, it creates objects as specified by a program. These objects are created in temporary memory. The memory is termed temporary as the contents of this memory are lost whenever the program terminates. If a program needs to have objects persist even when the computer program terminates, then the program needs to store the created objects out to permanent storage, typically on a hard drive. This is usually performed by creating a persistence class that declares the data and operations necessary for writing and reading (their data members) to and from permanent memory. All objects that need to be stored persistently must be instances of a class that has either a direct or transitive inheritance relationship with this persistence class.
The persistence class has at least two virtual operations declared that are implemented by all derived classes. One operation writes each of the object's class data members out to a buffer and the other operation reads data from a buffer and initializes an object's class data members. The write operation usually begins at the top of the object's class hierarchy, writes out the class identifier (usually some number) and then writes out the data members to a buffer. When this is done, control is passed to a subclass in the class hierarchy and the same write operation is performed for that class. This is continued until there are no more subclasses in the class hierarchy. The contents of the buffer are then written to permanent storage. This process is reversed when recreating, the object from permanent storage. A buffer is filled with data, the first field of which is a class identifier. This is used to create an object of the specified class. Control is then passed to the virtual read operation of the topmost class in the class hierarchy. This operation reads data from the buffer and initializes the data members. Control is then passed to the subclass and the process is repeated all the way down the class hierarchy.
There are two problems with the method of using a persistence data base class with storage and retrieval methods.
1. The first problem is that the retrieval method cannot load constant member data and cannot load reference data as this information must be supplied to the object at creation time. PA1 2. The second problem is using alternate permanent storage systems, e.g. file system, rational data base systems and Lotus Notes (TM) for object storage and retrieval, which is tightly linked with the implementation of the object. This yields an inflexible system that cannot have "plug and play persistence."
"Plug and Play" can be described as or defined as, a set specifications that allows a PC to configure itself automatically to work with peripherals (i.e. monitors, modems, printers) whereby the user can plug in peripherals and play without manually configuring the system. Plug and play PCs require a BIOS that supports Plug and Play and a expansion card.